package view;

import controller.ActivityController;
import java.util.Scanner;

/**
 * 菜单视图
 */
public class MenuView {
    private ActivityController activityController;
    private Scanner scanner;

    public MenuView(ActivityController activityController) {
        this.activityController = activityController;
        this.scanner = new Scanner(System.in);
    }

    // 显示主菜单
    public void showMainMenu() {
        while (true) {
            System.out.println("\n=== 校园活动管理系统（管理员模式）===");
            System.out.println("1. 查看所有活动");
            System.out.println("2. 帮学生报名活动");
            System.out.println("3. 查看学生已报名活动");
            System.out.println("4. 取消学生报名");
            System.out.println("0. 退出系统");
            System.out.print("请选择操作: ");

            int choice = Integer.parseInt(scanner.nextLine());

            switch (choice) {
                case 1:
                    activityController.viewAllActivities();
                    break;
                case 2:
                    activityController.adminSignUpActivity();
                    break;
                case 3:
                    activityController.viewStudentSignedActivities();
                    break;
                case 4:
                    activityController.adminCancelSignUp();
                    break;
                case 0:
                    System.out.println("感谢使用系统，再见!");
                    return;
                default:
                    System.out.println("无效选择，请重新输入!");
            }
        }
    }
}